<!DOCTYPE html>
<html>
    <head>
        <script type="text/javascript">
            function loginOut() {
                $.post("{:url('Login/loginOut')}", {}, function (e) {
                    layer.msg(e.msg, {icon: 6, time: 2000}, function () {
                        window.location.href = e.url;
                    });
                })
            }
        </script>
    </head>
    <style>
        #MenuName{
            color: #333333;
            font-size: 18px;
            font-family: "微软雅黑";
        }
        .Authority {
            background: #fff;
            padding: 10px 15px;
            border-bottom: 1px solid #dcdcdc;
        }

        .content{
            width: 100%;
            overflow: auto;
        }
        /*定义滚动条高宽及背景 高宽分别对应横竖滚动条的尺寸*/
        ::-webkit-scrollbar
        {
            width: 0px;
            height: 16px;
            background-color: #F5F5F5;
        }

        /*定义滚动条轨道 内阴影+圆角*/
        ::-webkit-scrollbar-track
        {
            -webkit-box-shadow: inset 0 0 0px rgba(242,242,242,0);
            border-radius: 10px;
            background-color: #F5F5F5;
        }

        /*定义滑块 内阴影+圆角*/
        ::-webkit-scrollbar-thumb
        {
            border-radius: 10px;
            -webkit-box-shadow: inset 0 0 0px rgba(242,242,242,0);
            background-color: #d1d1d1;
        }
    </style>
    <body>
        <div class="navbar navbar-default nav-top" style="margin-bottom: 20px;">
            <div class="container">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="javascript:void(0)bs-example-navbar-collapse-1" aria-expanded="false">
                        <span class="sr-only">Toggle navigation</span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </button>
                    <a class="navbar-brand navbar-logo" href="javascript:void(0)"><img src="{:uploadImgPath($company_config.img_config.admin_image)}"></a>
                </div>
                <!-- Collect the nav links, forms, and other content for toggling -->
                <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                    <ul class="nav navbar-nav nav-left">
                        {foreach $menu as $key => $val}
                        {if condition="$key < 5"}
                        <li {if condition="$controller eq UrlTrans($val.url)"}class="active"{/if}>
                            <a href="/{$val.url}" data-pid="{$val.id}" >{$val.title}</a>
                        </li>
                        {/if}
                        {/foreach}
                        <?php if(count($menu)>5){ ?>
                        <?php } ?>

                    </ul>

                    <ul class="nav navbar-nav navbar-right nav-right">
                        <li class="dropdown">
                            <a href="javascript:void(0)" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
                                <span class="glyphicon glyphicon-th"></span>
                                <span class="caret"></span></a>
                            <ul class="dropdown-menu">
                                <li onclick="removeclass(this)">
                                    <a href="{:url('index/index')}" >控制台</a>
                                </li>
                            </ul>
                        </li>

                        <li>
                            <a href="{:url('Announce/index')}"><span class="glyphicon glyphicon-volume-down"></span></a>
                        </li>
                        <li>
                            <a href="javascript:void(0)" class="dropdown-toggle head-name" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{$username}<img class="Head_img" src="{:Config('IMAGES_PATH')}{$portrait}"></a>
                            <ul class="dropdown-menu">
                                <li onclick="removeclass(this)">
                                    <a href="{:url('Users/PersonalInformation')}">个人资料 </a>
                                </li>
                                {if condition="$is_admin eq 1"}
                                <li onclick="removeclass(this)">
                                    <a href="{:url('babyadmin/Authgroup/index')}">权限分配</a>
                                </li>
                                {/if}
                                <li onclick="removeclass(this)">
                                    <a href="javascript:void(0)"  onclick="loginOut();">退出</a>
                                </li>
                            </ul>
                        </li>
                    </ul>
                </div>
                <!-- /.navbar-collapse -->
            </div>
            <!-- /.container-fluid -->
        </div>
        <script type="text/javascript">
            function removeclass(obj) {
                $(obj).parent().parent().removeClass('active')
            }

        </script>